package com.th.coupon.feign;

import com.th.coupon.common.exception.BaseCloudException;
import com.th.coupon.common.vo.CommonResponse;
import com.th.coupon.common.vo.SettlementInfo;
import com.th.coupon.feign.hystrix.SettlementClientHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 调用优惠卷结算服务
 * @author 涂航
 */
@FeignClient(value = "coupon-settlement-service",fallback = SettlementClientHystrix.class)
public interface SettlementClient {


    /**
     * 优惠卷规则计算
     * @param settlementInfo {@link SettlementInfo} 结算
     * @return
     * @throws BaseCloudException
     */
    @RequestMapping(value = "/coupon-settlement/settlement/compute",method = RequestMethod.POST)
    CommonResponse<SettlementInfo> computeRule(@RequestBody SettlementInfo settlementInfo) throws BaseCloudException;
}
